package com.woniu.springbootshiro.service;

import com.woniu.springbootshiro.mapper.LampInfoMapper;
import com.woniu.springbootshiro.pojo.LampInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LampInfoService {
  @Autowired
  private LampInfoMapper lampInfoMapper;

  public List<LampInfo> queryAllLamp() {
    return lampInfoMapper.queryAllLamp();
  }

  public int deleteOne(Integer id) {
    return lampInfoMapper.deleteOne(id);
  }

  public int insertOneLamp(LampInfo lampInfo) {
  return lampInfoMapper.insertSelective(lampInfo);
  }

  public LampInfo queryLampById(Integer id){
    return lampInfoMapper.selectByPrimaryKey1(id);
  }

  public int updateLampById(LampInfo lampInfo){
    return lampInfoMapper.updateByPrimaryKeySelective(lampInfo);
  }
}
